//
//  LQGBaseViewModel.swift
//  LQGBaseViewModel
//
//  Created by 罗建
//  Copyright (c) 2021 罗建. All rights reserved.
//

import Foundation

/// 业务层回调
public typealias VMCompletion = (_ success: Bool, _ message: String?) -> Void

/// 在主线程中异步回调
/// @param completion 业务层回调
/// @param success 是否成功
/// @param message 描述信息
public func VMCompletionOnMainQueue(completion: VMCompletion?, success: Bool, message: String?) {
    guard let completion = completion else {return}
    
    if Thread.isMainThread {
        completion(success, message)
    } else {
        DispatchQueue.main.async {
            completion(success, message)
        }
    }
}

/// 基础业务类
open class LQGBaseViewModel: NSObject {
    
}
